/**
 *
 */
package de.cbf.cam.dsa.rcp.model.entities;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import de.cbf.util.uuidheader.entities.NamedEntity;
import de.cbf.util.uuidheader.entities.UUIDHeader;
import de.cbf.util.uuidheader.exceptions.EntityMergeException;

/**
 * @author salter
 *
 */
public class ProfessionLevel extends NamedEntity{
	private static final Log logger = LogFactory.getLog(ProfessionLevel.class);

	protected Integer minAge;
	protected Integer maxAge;
	/**
	 *
	 */
	public ProfessionLevel() {

	}

	public ProfessionLevel(String name, Integer minAge, Integer maxAge) {
		super(name);
		this.minAge = minAge;
		this.maxAge = maxAge;
	}


	@Override
	protected void doMergeDataFrom(UUIDHeader entity, boolean i_am_older)
			throws EntityMergeException {
		throw new EntityMergeException("not implemented yet");
	}

	@Override
	public String toString() {
		return "ProfessionLevel["+fName+"]";
	}


	public Integer getMinAge() {
		return minAge;
	}
	public void setMinAge(Integer min) {
		this.minAge = min;
		if(min > maxAge){
			logger.error("Min("+min+") is set bigger than maxAge("+maxAge+")!");
		}
	}
	public Integer getMaxAge() {
		return maxAge;
	}
	public void setMaxAge(Integer max) {
		this.maxAge = max;
		if(minAge > max){
			logger.error("Max("+max+") is set smaller than minAge("+minAge+")!");
		}
	}




}
